Skip to content

[FEATURE] Add sorting modes to the plugin store#4398

Merged
Jack251970 merged 5 commits intoFlow-Launcher:devfrom
DavidGBrett:sorting-options-on-plugin-store
Apr 10, 2026
Merged

[FEATURE] Add sorting modes to the plugin store#4398
Jack251970 merged 5 commits intoFlow-Launcher:devfrom
DavidGBrett:sorting-options-on-plugin-store

Conversation

@DavidGBrett
Copy link
Copy Markdown
Contributor

@DavidGBrett DavidGBrett commented Apr 8, 2026

Summary

Add dropdown with sorting modes to the plugin store panel of the settings window.
Added the following modes:

  • Default
  • Name
  • Release Date
  • Updated Date

Default matches the current way it lists plugins, included the recently added / recently updated categories.
The other modes hide those categories as they no longer make sense / are needed, leaving only "Plugins" and "Installed".

Related to this request:
https://www.reddit.com/r/FlowLauncher/comments/1s8gcrm/plugin_sort_by_date_created_or_updated/

Closes #2845

UI

image (ignore the missing plugin icons - that just always happens in my local debug mode)

Summary by cubic

Adds sorting modes to the Plugin Store with a new dropdown (Default, Name, Release Date, Updated Date). Non‑default sorts collapse categories to only “Installed” and “Plugins”.

Summary of changes

  • Changed
    • External plugin list now sorted via GetSortedPlugins based on SelectedSortMode; view refreshes on change.
    • Grouping: Default uses DefaultCategory; other modes use InstallCategory; grouping updated in code-behind when sort mode changes; header split into two rows to fit the dropdown.
    • Localized labels for enum are loaded at ViewModel init; minor cleanup with no behavior change.
    • Spelling allowlist updated in .github/actions/spelling/expect.txt for CI.
  • Added
    • Sorting dropdown and PluginStoreSortMode enum (Default, Name, ReleaseDate, UpdatedDate) with localized labels and a "Sorting Mode:" label.
    • DateAdded and UpdatedDate to PluginStoreItemViewModel for sorting.
    • InstallCategory and UpdateCategoryGrouping to switch grouping when sort mode changes.
  • Removed
    • Hard‑coded ordering chain in ExternalPlugins.
    • Single Category property (replaced by DefaultCategory and InstallCategory).
  • Memory impact
    • Minimal. Same list materialization; small enum dropdown data.
  • Security risks
    • None. UI-only sorting and grouping.
  • Unit tests
    • No new tests included.

Written for commit 6f44d0c. Summary will update on new commits.

- Added new row in header
- Added dropdown menu to that new row
- Added localized options: "Name", "Release Date," "Updated Date" as well as a localized label "Sorting Mode:"

No functionality added, only ui changes.
- Add GetSortedPlugins to handle different sorts based on the SelectedSortMode
- Show only "None"/"Plugins" & "Installed" categories for sort modes other than default
@github-actions github-actions bot added this to the 2.2.0 milestone Apr 8, 2026
@prlabeler prlabeler bot added the bug Something isn't working label Apr 8, 2026
@DavidGBrett DavidGBrett changed the title Sorting options on plugin store [Feature] Add sorting modes to the plugin store Apr 8, 2026
@prlabeler prlabeler bot added the enhancement New feature or request label Apr 8, 2026
@DavidGBrett DavidGBrett marked this pull request as ready for review April 8, 2026 16:05
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 8, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ead20e5-299d-4136-89ed-36fe08fa4303

📥 Commits

Reviewing files that changed from the base of the PR and between 9b463b7 and 6f44d0c.

📒 Files selected for processing (1)
  • Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml

📝 Walkthrough

Walkthrough

Adds Plugin Store sorting: localization entries, a sort-mode enum and dropdown bound to the view model, plugin item date/category properties, sorting logic in the view model, and dynamic grouping updates in the view code-behind. No existing keys removed.

Changes

Cohort / File(s) Summary
Localization
Flow.Launcher/Languages/en.xaml
Added five new resource keys for sort modes and the combobox label (PluginStoreSortModeDefault, PluginStoreSortModeName, PluginStoreSortModeReleaseDate, PluginStoreSortModeUpdatedDate, PluginStoreSortingModeComboboxLabel).
ViewModel Logic
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs
Added PluginStoreSortMode enum and SortModeData type; SortModes list and SelectedSortMode property with change notifications; introduced GetSortedPlugins(...) and constructor/localization update call.
View Layout & Binding
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
Reworked header layout and sizing; added Sort Mode ComboBox bound to SortModes/SelectedSortMode; adjusted search textbox positioning and grouping target.
View Code-Behind
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs
On navigation and when SelectedSortMode changes, calls UpdateCategoryGrouping() which clears/sets CollectionViewSource.GroupDescriptions to group by DefaultCategory (Default mode) or InstallCategory (other modes), then refreshes the view.
Plugin Item Model
Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs
Added DateAdded and UpdatedDate; renamed CategoryDefaultCategory (recency-based) and added InstallCategory (Installed/None) for alternate grouping/sorting.
Misc (spelling)
.github/actions/spelling/expect.txt
Added new words (uninstaller, taskbar, taskbars, ikw) to spelling exceptions.

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as Sort ComboBox
    participant VM as SettingsPanePluginStoreViewModel
    participant CB as SettingsPanePluginStore.xaml.cs
    participant CVS as CollectionViewSource
    participant Items as PluginStoreItemViewModel List

    User->>UI: select sort mode
    UI->>VM: set SelectedSortMode
    VM->>VM: raise PropertyChanged("SelectedSortMode") and ("ExternalPlugins")
    VM->>Items: GetSortedPlugins(SelectedSortMode)
    Items->>Items: sort by Name / DateAdded / UpdatedDate or by DefaultCategory
    VM->>CB: PropertyChanged observed
    CB->>CB: UpdateCategoryGrouping()
    CB->>CVS: clear/add GroupDescriptions (DefaultCategory or InstallCategory)
    CB->>CVS: Refresh()
    CVS->>UI: update displayed items
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • onesounds
  • jjw24
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title '[FEATURE] Add sorting modes to the plugin store' directly and clearly describes the main change: adding sorting functionality to the plugin store.
Description check ✅ Passed The PR description comprehensively explains the feature addition, including the four sorting modes, behavior differences, affected files, UI changes, and related issue reference.
Linked Issues check ✅ Passed The PR fully addresses issue #2845 by implementing all requested sorting modes: Name, Release Date, and Updated Date, plus a Default mode. The implementation provides UI dropdown with proper localization and functional sorting.
Out of Scope Changes check ✅ Passed All changes are within scope of the sorting feature: enum and UI additions, sort logic, category grouping adjustments, localization strings, and spelling list updates are all directly related to implementing the requested sorting functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs (1)

44-64: ⚠️ Potential issue | 🟠 Major

Potential null reference issue with nullable DateTime arithmetic.

_newPlugin.LatestReleaseDate and _newPlugin.DateAdded are DateTime? (per UserPlugin.cs lines 68-73). Subtracting a nullable DateTime? from DateTime.Now without null checks can cause runtime exceptions or undefined behavior when these values are null.

🛠️ Proposed fix with null checks
 public string DefaultCategory
 {
     get
     {
         string category = None;
-        if (DateTime.Now - _newPlugin.LatestReleaseDate < TimeSpan.FromDays(7))
+        if (_newPlugin.LatestReleaseDate.HasValue && 
+            DateTime.Now - _newPlugin.LatestReleaseDate.Value < TimeSpan.FromDays(7))
         {
             category = RecentlyUpdated;
         }
-        if (DateTime.Now - _newPlugin.DateAdded < TimeSpan.FromDays(7))
+        if (_newPlugin.DateAdded.HasValue && 
+            DateTime.Now - _newPlugin.DateAdded.Value < TimeSpan.FromDays(7))
         {
             category = NewRelease;
         }
         if (_oldPluginPair != null)
         {
             category = Installed;
         }

         return category;
     }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs` around lines 44 - 64,
The DefaultCategory getter performs DateTime.Now - _newPlugin.LatestReleaseDate
and DateTime.Now - _newPlugin.DateAdded where those fields are nullable
(DateTime?); guard these uses by checking _newPlugin.LatestReleaseDate.HasValue
and _newPlugin.DateAdded.HasValue (or using GetValueOrDefault with an existence
check) before doing the subtraction, and only assign RecentlyUpdated/NewRelease
when the corresponding nullable has a value; keep the existing logic around
_oldPluginPair and the returned category intact.
🧹 Nitpick comments (1)
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs (1)

88-105: Minor formatting inconsistency.

Line 102: else{ is missing a space before the brace.

🔧 Suggested fix
         // Otherwise we only split by installed or not
-        else{
+        else
+        {
             groupDescriptions.Add(new PropertyGroupDescription(nameof(PluginStoreItemViewModel.InstallCategory)));
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs` around
lines 88 - 105, The method UpdateCategoryGrouping has a formatting
inconsistency: change the `else{` to `else {` to match project style; update the
else block in UpdateCategoryGrouping (which currently adds a
PropertyGroupDescription for PluginStoreItemViewModel.InstallCategory when
_viewModel.SelectedSortMode is not PluginStoreSortMode.Default) so the brace
spacing is corrected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs`:
- Around line 44-64: The DefaultCategory getter performs DateTime.Now -
_newPlugin.LatestReleaseDate and DateTime.Now - _newPlugin.DateAdded where those
fields are nullable (DateTime?); guard these uses by checking
_newPlugin.LatestReleaseDate.HasValue and _newPlugin.DateAdded.HasValue (or
using GetValueOrDefault with an existence check) before doing the subtraction,
and only assign RecentlyUpdated/NewRelease when the corresponding nullable has a
value; keep the existing logic around _oldPluginPair and the returned category
intact.

---

Nitpick comments:
In `@Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs`:
- Around line 88-105: The method UpdateCategoryGrouping has a formatting
inconsistency: change the `else{` to `else {` to match project style; update the
else block in UpdateCategoryGrouping (which currently adds a
PropertyGroupDescription for PluginStoreItemViewModel.InstallCategory when
_viewModel.SelectedSortMode is not PluginStoreSortMode.Default) so the brace
spacing is corrected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 64000be2-df6c-4096-9f7e-77ba3461f3b4

📥 Commits

Reviewing files that changed from the base of the PR and between 3e320d5 and c6da34b.

📒 Files selected for processing (5)
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs
  • Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
  • Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs
  • Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs

@DavidGBrett
Copy link
Copy Markdown
Contributor Author

DavidGBrett commented Apr 8, 2026

⚠️ Outside diff range comments (1)

Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs (1)> 44-64: ⚠️ Potential issue | 🟠 Major

Potential null reference issue with nullable DateTime arithmetic.

This is unrelated to my change, this is an issue in the existing code.
Not sure if this should really be addressed in this PR.

@coderabbitai coderabbitai bot removed bug Something isn't working enhancement New feature or request labels Apr 10, 2026
Copy link
Copy Markdown
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Count Data Context Binding Path Target Target Type Description File Line Project
Error 1408 PluginStoreItemViewModel IcoPathAbsolute Image.Source ImageSource IcoPathAbsolute property not found on object of type PluginStoreItemViewModel. D:\Source\Repos\Flow.Launcher - DavidGBrett\Flow.Launcher\SettingPages\Views\SettingsPanePluginStore.xaml 357 Flow.Launcher

Could you please resolve this binding issue?

@prlabeler prlabeler bot added bug Something isn't working enhancement New feature or request labels Apr 10, 2026
@coderabbitai coderabbitai bot removed the bug Something isn't working label Apr 10, 2026
@DavidGBrett
Copy link
Copy Markdown
Contributor Author

Could you please resolve this binding issue?

Hi @Jack251970
Thank you for the review.

As that issue is actually an existing one unrelated to this change I proposed a fix in a new PR: #4405

@DavidGBrett DavidGBrett changed the title [Feature] Add sorting modes to the plugin store [FEATURE] Add sorting modes to the plugin store Apr 10, 2026
@prlabeler prlabeler bot added the bug Something isn't working label Apr 10, 2026
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 10, 2026

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

.github/actions/spelling/expect.txt

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970
APR 0 additions & 1 deletions
MAR
FEB 7 additions & 4 deletions
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 99%

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs

Activity based on git-commit:

Jack251970
APR
MAR 1 additions & 1 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@coderabbitai coderabbitai bot removed bug Something isn't working enhancement New feature or request labels Apr 10, 2026
Copy link
Copy Markdown
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@Jack251970 Jack251970 enabled auto-merge April 10, 2026 17:11
@Jack251970 Jack251970 added enhancement New feature or request and removed 10 min review labels Apr 10, 2026
@Jack251970 Jack251970 merged commit 7fdf3a2 into Flow-Launcher:dev Apr 10, 2026
9 checks passed
@DavidGBrett DavidGBrett deleted the sorting-options-on-plugin-store branch April 10, 2026 17:29
@DavidGBrett
Copy link
Copy Markdown
Contributor Author

⚠️ Outside diff range comments (1)

Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs (1)> 44-64: ⚠️ Potential issue | 🟠 Major

Potential null reference issue with nullable DateTime arithmetic.

I've opened a new PR ( #4406 ) to resolve this existing issue seperately as well.

@Jack251970
Copy link
Copy Markdown
Member

Thanks for your fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sorting option in plugin store menu

2 participants